package demo1.service.impl;

import demo1.dao.AccountDao;
import demo1.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AccountServiceImpl_one implements AccountService {
    @Autowired
    AccountDao dao;
    @Override
    public void transfer(String from, String to, Double money) {
        dao.update(from,-money);
        int a=1/0;
        dao.update(to,money);
    }

    @Override
    public void query(String name) {
        System.out.println(name+"的余额为："+dao.selectMoney(name));
    }
}
